home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 192 / 192.d81 / rh-pinochle 2 (.txt) < prev    next >
Encoding:
Commodore BASIC  |  2000-01-01  |  24.8 KB  |  639 lines

  1. 1 rem "rh-pinochle 2c" 2000.05.09             *** compacted version
  2. 2 gosub3002
  3. 3 gosub12:onqgoto9,4,3,3,3
  4. 4 gosub1002:onqgoto9,4:gosub1202:onqgoto9,4:ifbp=290then4
  5. 5 gosub1402:onqgoto9,4:gosub1802:onqgoto9,4:iff=2thenon2+(q<>5)goto4,3
  6. 6 gosub2002:onqgoto9,4,4,4,3
  7. 9 goto4002
  8. 12 pokevl+39,1:ifq=4thenq=3:goto30
  9. 18 sysml+9:i%=cr%:on2+(i%>0)goto22:sysml+60,a$(28):on2+(i%>0)goto22
  10. 20 on1+fnhp(p)goto22:on2+(r1%=0andr2%=0)goto18:q=4:goto30
  11. 22 q=3:ifi%<5thenoni%gosub2978,2902,2916,2964:onqgoto30,30:on2+fnhp(p)goto18,30
  12. 24 ifbn>-1thenifi%>=bnthenbq=i%-bn:goto30
  13. 26 bq=-1:c=i%-5:a=(c>=cn):c=c+cn*a
  14. 28 on2+(s%(c,p)>-1)goto30:on2+(c=0ora)goto18:c=c-1:on2+s%(c,p)goto18
  15. 30 pokevl+39,7:return
  16. 36 sysml+24,(m*b%(d%(3,0))):wait653,1,1:return
  17. 102 on2+fnec(p)gosub110,122:return
  18. 110 forc=0tocn-2:gosub138:gosub146:gosub162:onp+1gosub190,204,212,204:next
  19. 116 c=cn-1:gosub138:gosub146:gosub154:return
  20. 122 on2+(ca=0)goto134:t=pand253:forc=catocz:ontgoto130
  21. 128 sysml+126,x%(c,p),x%(c,p),y%(c,p),y%(c,p)+1,97,98,c%(2),c%(2):goto132
  22. 130 sysml+12,x%(c,p),y%(c,p),a$(23)
  23. 132 next
  24. 134 return
  25. 138 r=r%(c,p):s=s%(c,p):return
  26. 146 x=x%(ca+c,p):y=y%(ca+c,p):return
  27. 154 gosub162:onp+1gosub170,204,212,204:poke646,c%(2):return
  28. 162 poke646,c%(3+(sand253)):return
  29. 170 gosub162:sysml+12,x,y,r$(r)+a$(24):sysml+12,x,y+1,s$(s)+a$(24)
  30. 180 sysml+12,x,y+2,a$(24)+s$(s):sysml+12,x,y+3,a$(24)+r$(r):poke646,c%(2):return
  31. 190 gosub162:sysml+12,x,y,r$(r):sysml+12,x,y+1,s$(s)
  32. 196 poke646,c%(0):sysml+12,x+1,y,a$(25):sysml+12,x+1,y+1,a$(25)
  33. 198 sysml+12,x,y+2,a$(26):sysml+12,x,y+3,a$(26):poke646,c%(2):return
  34. 204 sysml+12,x,y,r$(r)+s$(s):return
  35. 212 sysml+12,x,y,r$(r):sysml+12,x,y+1,s$(s):return
  36. 220 gosub146:onpgoto226,228,226:sysml+30,x,x-2*(c=cn-1),y,y+3,255,cc:goto230
  37. 226 sysml+30,x,x+1,y,y,255,cc:goto230
  38. 228 sysml+30,x,x,y,y+1,255,cc
  39. 230 return
  40. 234 l=len(a$):onpgoto242,244,246
  41. 240 x=20-l/2:y=ys%(p)-7:goto248
  42. 242 x=xs%(p)+5:y=11:goto248
  43. 244 x=20-l/2:y=ys%(p)+5:goto248
  44. 246 x=xs%(p)-4-l:y=11
  45. 248 poke199,1:sysml+12,x,y,a$:poke199,0:return
  46. 254 sysml+30,x,x+9,y,y,160,c%(2):return
  47. 262 sysml+12,x,y,a$:return
  48. 270 c=-1:fors=3to0step-1:sn%(s,p,p)=0:forr=5to0step-1
  49. 276 ifch%(r,s,p,p)>0thenforn=1toch%(r,s,p,p):c=c+1:r%(c,p)=r:s%(c,p)=s:next
  50. 278 sn%(s,p,p)=sn%(s,p,p)+ch%(r,s,p,p):next:so%(s,p)=12-sn%(s,p,p):next:return
  51. 284 sysml+30,x%(0,1)+2,x%(0,3)-1,y%(0,2)+2,y%(0,0)-1,160,c%(2):return
  52. 292 gosub146:onpgoto316,318,316
  53. 298 ift%(p)>0thenc=t%(p)-1:gosub138:ifs>-1then302
  54. 300 sysml+30,x,x,y,y+3,160,c%(2):goto308
  55. 302 sysml+30,x,x,y,y+1,160,c%(1)
  56. 304 gosub162:sysml+12,x,y+2,s$(s):sysml+12,x,y+3,r$(r):poke646,c%(2)
  57. 306 sysml+30,x-1,x-1,y,y+3,160,c%(1)
  58. 308 x=x+1:sysml+30,x,x,y,y+3,160,c%(2):x=x+1
  59. 310 ift%(p)<11thenc=t%(p)+1:gosub138:ifs>-1then314
  60. 312 sysml+30,x,x,y,y+3,160,c%(2):goto320
  61. 314 gosub162:sysml+12,x,y,r$(r):sysml+12,x,y+1,s$(s):poke646,c%(2):goto320
  62. 316 sysml+30,x,x+1,y,y,160,c%(2):goto320
  63. 318 sysml+30,x,x,y,y+1,160,c%(2)
  64. 320 c=t%(p):return
  65. 326 on1+fnec(p)goto338:onpgoto334,336,334
  66. 332 sysml+30,x%(0,p),x%(15,p)+2,y%(0,p),y%(0,p)+3,160,c%(2):goto338
  67. 334 sysml+30,x%(0,p),x%(0,p)+1,y%(0,p),y%(15,p),160,c%(2):goto338
  68. 336 sysml+30,x%(0,p),x%(15,p),y%(0,p),y%(0,p)+1,160,c%(2)
  69. 338 return
  70. 342 sysml+39,hg:pokerv+48,peek(mv+2):return
  71. 350 sysml+42,hg:pokemv,lg:pokemv+2,peek(rv+48):return
  72. 358 sysml+48,12,28,13,15,fna(6+z):gosub366:bn=n+1:return
  73. 366 n=peek(mv+2):pokerv+49,n:i%=peek(rv+50+z):pokemv+2,n+i%
  74. 372 m=fna(11+z):sysml+129,m,m+4*i%,hd*256+4*n:return
  75. 378 sysml+30,12,28,13,15,160,c%(2):pokemv+2,peek(rv+49):bn=-1:return
  76. 386 sysml+36,i%,255,c%(1):return
  77. 394 sysml+36,i%,255,c%(3):return
  78. 402 sysml+30,xs%(1)+1,xs%(3)-1,ys%(2)+1,ys%(0)-1,160,c%(2)
  79. 408 sysml+30,xs%(0)-1,xs%(0)+10,ys%(0),ys%(0),160,c%(1)
  80. 410 sysml+30,xs%(1),xs%(1),ys%(1)-1,ys%(1)+10,160,c%(1)
  81. 412 sysml+30,xs%(2)-1,xs%(2)+10,ys%(2),ys%(2),160,c%(1)
  82. 414 sysml+30,xs%(3),xs%(3),ys%(3)-1,ys%(3)+10,160,c%(1):return
  83. 420 gosub466:fori=0to1:u%(i)=p%(sb,i,0)+p%(sb,a2%(i),0):v%(i)=u%(i):next
  84. 428 poke646,c%(0):sysml+12,14,8,a$(12):on2+(f=2)goto436
  85. 430 i=tb:on1+np%(i)goto434:i=td:on1+(np%(i)=0)goto436
  86. 432 v%(i)=10*m%(0+sb,i)+10*m%(0+sb,a2%(i)):on2+(u%(i)=v%(i))goto436
  87. 434 poke646,c%(3+i):sysml+12,13,13,t$(i):poke646,c%(0):sysml+12,17,13,a$(13)
  88. 436 l=4:fori=0to1:poke646,c%(3+i):y=9+i:sysml+12,10,y,t$(i)
  89. 438 n=np%(i):gosub494:sysml+12,10+4,y,a$:n=u%(i):gosub494:sysml+12,10+9,y,a$
  90. 440 n=np%(i)+v%(i):on1+(i=tb)goto442:n=n*(f+1):n=n+(n+bp)*(np%(i)<np%(2)orf=2)
  91. 442 gosub494:sysml+12,10+15,y,a$:np%(i)=n:ns%(i)=ns%(i)+n:next
  92. 446 poke646,c%(3+tb):sysml+12,14,12,t$(tb)
  93. 448 poke646,c%(0):sysml+12,18,12,a$(15+(np%(tb)<bp)):poke646,c%(2):m=240:gosub36:gosub474
  94. 454 on2+(ns%(0)<1500andns%(1)<1500)goto462
  95. 456 q=5:gosub466:t=tb+(tb-td)*(ns%(tb)<1500):poke646,c%(3+t):sysml+12,12,10,t$(t)
  96. 460 poke646,c%(0):sysml+12,16,10,a$(16):poke646,c%(2)
  97. 462 return
  98. 466 sysml+30,9,30,7,14,160,c%(4)+16:return
  99. 474 sysml+30,xs%(1)+6,xs%(1)+8,ys%(2),ys%(2),160,c%(1)
  100. 480 sysml+30,xs%(3)-4,xs%(3)-1,ys%(2),ys%(2),160,c%(1)
  101. 482 sysml+30,xs%(1)+6,xs%(1)+9,ys%(0)+1,ys%(0)+2,160,c%(1):l=5:x=xs%(3)-5
  102. 486 fort=0to1:poke646,c%(3+t):n=ns%(t):gosub494:y=ys%(0)+1+t:gosub262:next:poke646,c%(2):return
  103. 494 a$=right$(a$(27)+str$(n),l):return
  104. 502 onpgoto510,508,510
  105. 508 poke646,c%(3):sysml+12,xs%(p)+2,ys%(p),a$(m):goto512
  106. 510 poke646,c%(4):fori=1to6:sysml+12,xs%(p),ys%(p)+i+1,mid$(a$(m),i,1):next
  107. 512 poke646,c%(2):return
  108. 518 fors=0to3:k=0+s:m%(k,p)=ch%(0,s,p,p)
  109. 528 n=0:forl=0to1:a=(ch%(2,s,p,p)>landch%(3,s,p,p)>l):n=n-a:l=1+(1-l)*a:next
  110. 530 k=8+s:m%(k,p)=n
  111. 532 n=0:forl=0to1:forr=1to5:gosub558:r=5+(5-r)*a:next:n=n-a:l=1+(1-l)*a:next
  112. 534 k=17+s:m%(k,p)=n
  113. 536 k=4+s:m%(k,p)=((ch%(2,s,p,p)>1)+(ch%(3,s,p,p)>1))*(m%(17+s,p)=1):next
  114. 542 fork=13to16:r=k-12-(k=16):n=0
  115. 544 forl=0to1:fors=0to3:gosub558:s=3+(3-s)*a:next:n=n-a:l=1+(1-l)*a:next:m%(k,p)=n:next
  116. 550 k=12
  117. 552 m%(k,p)=-(ch%(1,0,p,p)>0andch%(2,3,p,p)>0)-(ch%(1,0,p,p)>1andch%(2,3,p,p)>1)
  118. 554 return
  119. 558 a=(ch%(r,s,p,p)>l):return
  120. 566 m=0:forj=0to3:k=13+j:m=m+(40+20*j)*fnmm(m%(k,p)):next
  121. 578 ifm%(12,p)>0thenm=m+40:ifm%(12,p)>1thenm=m+260
  122. 582 fors=0to3:m=m+20*m%(8+s,p):next:fors=0to3
  123. 588 p%(s,p,0)=m+10*m%(0+s,p):k=17+s:p%(s,p,0)=p%(s,p,0)+150*fnmm(m%(k,p))
  124. 590 onm%(k,p)goto592,594:p%(s,p,0)=p%(s,p,0)+20*m%(8+s,p):goto596
  125. 592 p%(s,p,0)=p%(s,p,0)+20*m%(4+s,p)
  126. 594 p%(s,p,0)=p%(s,p,0)-20*m%(8+s,p)
  127. 596 next:return
  128. 1002 q=3:gosub402:pokemv+2,4:np%(0)=0:np%(1)=0
  129. 1006 pd=a1%(pd)+(a1%(pd)-pd)*(f=2andbp=290):p=pd
  130. 1008 m=17:gosub502:poke176,lr:poke177,hr:poke178,48:sysrl
  131. 1010 sysml+129,fna(2),fna(2)+768,fna(3):sysml+129,fna(2),fna(2)+128,fna(5)
  132. 1012 fori=0to3:p=a1%(p):gosub1034:gosub270:gosub102:next:return
  133. 1034 forc=0to11:v=int((peek(rv+12*p+c)-1)/2):s=int(v/6):r=int(v-s*6)
  134. 1038 ch%(r,s,p,p)=ch%(r,s,p,p)+1:next:return
  135. 1202 bp=290:p=a1%(pd):pb=p:v=0:fori=0to3:bp%(i)=0:v%(i)=-1:next
  136. 1206 gosub518:gosub566:gosub1268:w=0:fors=1to3:ifp%(s,p,3)<p%(w,p,3)then1214
  137. 1210 ifp%(s,p,3)>p%(w,p,3)thenw=s:goto1214
  138. 1211 ifu%(s)<u%(w)then1214
  139. 1212 ifu%(s)>u%(w)thenw=s:goto1214
  140. 1213 ifsn%(s,p,p)>sn%(w,p,p)thenw=s
  141. 1214 next:v%(p)=w
  142. 1224 iffnhp(p)thengosub1360:onqgoto1264,1264,1238
  143. 1236 gosub1346:gosub12:onqgoto1264,1264
  144. 1238 ifathenpb=p:a$=str$(bp):goto1242
  145. 1240 v=vorb%(p):a$=a$(0)
  146. 1242 gosub234:m=40:gosub36:if(vorb%(pb))=15thenon2+(v=15)goto1245,1248
  147. 1244 p=a1%(p):on2+v%(p)goto1206:on2+((vandb%(p))=0)goto1224,1244
  148. 1245 gosub466:poke646,c%(0):sysml+12,16,10,a$(18):poke646,c%(2):m=40:gosub36:goto1264
  149. 1248 gosub284:p=pb:tb=pband253:td=1-tb:iffnhp(p)thengosub1382:onqgoto1264,1264,1254
  150. 1252 sb=v%(p):gosub12:onqgoto1264,1264
  151. 1254 a$=a$(4+sb):gosub234:m=40:gosub36:gosub284:t=tb:m=19:gosub502:s=sb:gosub162
  152. 1260 sysml+12,xs%(p),ys%(p),s$(sb):sysml+12,xs%(p)+9*(1-t),ys%(p)+9*t,s$(sb)
  153. 1261 poke646,c%(3+t):l=4:n=bp:gosub494:x=xs%(3)-4:y=ys%(2):gosub262:poke646,c%(2)
  154. 1264 return
  155. 1268 fors=0to3:p%(s,p,1)=0:p%(s,p,2)=0:u%(s)=0:next
  156. 1276 fors=0to3:m=sn%(s,p,p):ifm=0then1280
  157. 1278 n=0:forr=5to0step-1:n=n+2:u%(s)=u%(s)+ch%(r,s,p,p):r=r+r*(n>=m):next
  158. 1280 next:fors=0to3:sp=s:fork=1to3:sp=a1%(sp):p%(s,p,1)=p%(s,p,1)+u%(sp)*20:next:next
  159. 1284 fors=0to3:j=0:m=sn%(s,p,p)+int(so%(s,p)/3+0.5):ifsn%(s,p,p)=0then1290
  160. 1285 ifu%(s)>=3thenp%(s,p,1)=p%(s,p,1)+20*m:goto1290
  161. 1286 n=0:forr=5to0step-1:n=n+2:j=j+ch%(r,s,p,p):r=r+r*(n>=m):next
  162. 1288 p%(s,p,1)=p%(s,p,1)+20*(j+int(m/3-1))
  163. 1290 next:fors=0to3:p%(s,p,1)=250+(250-p%(s,p,1))*(p%(s,p,1)<240):next
  164. 1294 m=2+d%(0,0):t=(pand253):n=int((ns%(t)-ns%(1-t))/500)
  165. 1296 on2+(n<1)goto1299:on2+(ns%(t)+n*140<1500)goto1299:m=m-n:m=m+(m-1)*(m<1)
  166. 1299 fors=0to3:on2+(sn%(s,p,p)<4)goto1326:n=0
  167. 1302 k=12:ifm%(k,p)=2then1308
  168. 1303 onsgoto1308,1308:r=3-a2%(s):on2+(ch%(r,s,p,p)=2)goto1308:sp=3-s
  169. 1304 ifch%(r,s,p,p)=1andch%(a2%(s),sp,p,p)=0thenn=1:p%(s,p,2)=40+30:goto1308
  170. 1305 ifch%(r,s,p,p)=0andch%(a2%(s),sp,p,p)=2thenn=0:p%(s,p,2)=40+90:goto1308
  171. 1306 ifch%(r,s,p,p)=1andch%(a2%(s),sp,p,p)=2thenn=0:p%(s,p,2)=90
  172. 1308 k=17+s:onm%(k,p)goto1316,1320
  173. 1312 j=5:l=0:forr=1to5:gosub558:j=j+a:next:ifj>2orn+j>mthen1320
  174. 1314 n=n+j:p%(s,p,2)=p%(s,p,2)+(150+20*(m%(8+s,p)=1)):ifn=mthen1326
  175. 1316 j=5:l=1:forr=1to5:gosub558:j=j+a:next:ifj>2orn+j>mthen1320
  176. 1318 n=n+j:p%(s,p,2)=p%(s,p,2)+(1500-150)*(1/3)^j:ifn=mthen1326
  177. 1320 k=16:onm%(k,p)goto1324,1326
  178. 1322 j=4:forsp=0to3:j=j+(ch%(5,sp,p,p)>0):next:ifn+j>mthen1326
  179. 1323 n=n+j:p%(s,p,2)=p%(s,p,2)+100+80*(n=4):ifn=mthen1326
  180. 1324 j=4:forsp=0to3:j=j+(ch%(5,sp,p,p)>1):next:ifn+j>mthen1326
  181. 1325 n=n+j:p%(s,p,2)=p%(s,p,2)+(1000-100)*(1/3)^j
  182. 1326 next:fors=0to3:p%(s,p,3)=p%(s,p,0)+p%(s,p,1)+p%(s,p,2):next
  183. 1336 m=40*(m%(13,p)=1)+60*(m%(14,p)=1andm%(15,p)=0)+80*(m%(15,p)=1andm%(14,p)=0)
  184. 1337 fors=0to3:p%(s,p,3)=p%(s,p,3)+m+40*(ch%(5,s,p,p)=0):next
  185. 1338 fors=0to3:ifp%(s,p,1)=250thenifp%(s,p,3)-250<250thenp%(s,p,3)=500
  186. 1340 next:return
  187. 1346 a=(v<>5andv<>10andp%(v%(p),p,3)>bp):ifa=0orv=0orv%(a2%(p))=-1then1354
  188. 1352 a=((vandb%(a2%(p)))=b%(a2%(p))orp%(v%(p),p,3)>p%(v%(a2%(p)),a2%(p),3))
  189. 1354 bp=bp-10*a:ifa=0ord%(0,0)<>2orv%(p)>-1then1358
  190. 1355 j=4:l=0:r=5:fors=0to3:gosub558:j=j+a:next:bp%(p)=-(j=1)
  191. 1356 bp%(p)=bp%(p)-2*(4-ch%(1,0,p,p)-ch%(2,3,p,p)=1)
  192. 1357 bp=bp+10*bp%(p):ifbp%(p)=0thenbp%(p)=4
  193. 1358 return
  194. 1360 z=0:gosub358:l=4:n=bp+10:x=18:y=15
  195. 1366 gosub494:gosub262:gosub12:on2+(q<>3)goto1379
  196. 1370 onbqgoto1378,1374,1376:a=0:goto1379
  197. 1374 n=n+10*(n>bp+10):goto1366
  198. 1376 n=n-10*(n<9990):goto1366
  199. 1378 a=-1:bp=n
  200. 1379 gosub378:return
  201. 1382 z=1:gosub358:gosub12:gosub378:ifq=3thensb=bq
  202. 1390 return
  203. 1402 px=a2%(pb):p=px:iffnhp(p)thenz=5:gosub366:gosub1728:onqgoto1428,1428,1412
  204. 1410 gosub1432:gosub12:onqgoto1428,1428
  205. 1412 gosub1698:p=pb:gosub270:gosub518:gosub326:ca=0:cz=15:cn=16:gosub102
  206. 1416 iffnhp(p)thenz=6:gosub366:gosub1728:onqgoto1428,1428,1420
  207. 1418 gosub1560:gosub12:onqgoto1428,1428
  208. 1420 gosub1710:p=pb:gosub270:gosub518:gosub566:gosub326:ca=2:cz=13:cn=12:gosub102
  209. 1424 p=px:gosub270:gosub518:gosub566:gosub102:pokemv+2,4
  210. 1428 return
  211. 1432 n=-1:u=0:a$=a$(8):gosub234
  212. 1440 onsbgoto1448,1448:on2+(m%(12,p)=2)goto1460:on2+((bp%(pb)and2)=2)goto1446
  213. 1441 r=3-a2%(sb):sp=3-sb
  214. 1442 onch%(r,sb,p,p)+1goto1448,1444:on2+(ch%(a2%(sb),sp,p,p)=0)goto1446,1448
  215. 1444 ifch%(a2%(sb),sp,p,p)<>2then1448
  216. 1446 forc=0to11:on2+fnpl(0)gosub1550:next
  217. 1448 forc=0to11:iffnfr(0)andch%(r%(c,p),sb,p,p)=2thengosub1550:c=c+1
  218. 1452 next:ifn=3then1542
  219. 1456 forc=0to11:on2+(fnfr(0)andch%(r%(c,p),sb,p,p)=1)gosub1550:next:ifn=3then1542
  220. 1460 forc=0to11:ifr%(c,p)=5andch%(5,s%(c,p),p,p)=2thengosub1550:c=c+1
  221. 1466 next:ifn=3then1542
  222. 1469 if(bp%(p)and1)=1thenl=1:fors=0to3:gosub558:s=s+(s-3)*a:next:ifathen1474
  223. 1470 forc=0to11:ifr%(c,p)=5andch%(5,s%(c,p),p,p)=1thengosub1550
  224. 1472 next:ifn=3then1542
  225. 1474 onsbgoto1480,1480:ifm%(12,p)=2then1480
  226. 1478 forc=0to11:gosub138:on2+(s=3-sbandr=a2%(sb))gosub1550:next:ifn=3then1542
  227. 1480 forc=0to11:on2+(fnfr(0)and(m%(12,p)<>2ornotfnpl(0)))gosub1550:next:ifn=3then1542
  228. 1488 forc=0to11:on2+(r%(c,p)=5)gosub1550:next:ifn=3then1542
  229. 1492 onsbgoto1500,1500
  230. 1494 ifm%(12,p)<>2orn=-1thenforc=0to11:on2+fnpl(0)gosub1550:next:ifn=3then1542
  231. 1500 forc=0to11:on2+(s%(c,p)=sbandr%(c,p)=0)gosub1550:next:ifn=3then1542
  232. 1506 forc=0to11:on2+(r%(c,p)=4andch%(5,s%(c,p),p,p)=2)gosub1550:next:ifn=3then1542
  233. 1512 fork=2to0step-1:forc=0to11:on2+(r%(c,p)=0andch%(5,s%(c,p),p,p)=k)gosub1550:next
  234. 1518 ifn=3then1534
  235. 1522 forc=0to11:gosub138:on2+(r=1ands<>0andch%(5,s,p,p)=k)gosub1550:next:ifn=3then1534
  236. 1528 forc=0to11:gosub138:ifr=2ands<>3andm%(8+s,p)=0andch%(5,s,p,p)=kthengosub1550
  237. 1532 next
  238. 1534 next:ifn=3then1542
  239. 1538 fork=2to0step-1:forc=0to11:on2+(notfnpl(0)andch%(5,s%(c,p),p,p)=k)gosub1550:next:next
  240. 1542 gosub254:iffnec(p)thenforc=0to11:on2+((uandb%(c))<>0)gosub220:next:m=100:gosub36
  241. 1546 return
  242. 1550 if(uandb%(c))=0thenn=n+1:u=uorb%(c):v%(n)=c:ifn=3thenc=11:k=0
  243. 1556 return
  244. 1560 n=0:forc=0to15:u%(c)=0:next:a$=a$(8):gosub234
  245. 1570 ifm%(17+sb,pb)=2thenn=10:forc=0to15:gosub138:u%(c)=fnfr(0):next:goto1580
  246. 1574 fork=16to13step-1
  247. 1576 ifm%(k,pb)=2thenn=8:v=k-12-(k-16):forc=0to15:gosub138:u%(c)=(r=v):next:k=13
  248. 1578 next
  249. 1580 ifm%(12,pb)<>2then1588
  250. 1584 ifsb=1orsb=2thenn=12:forc=0to15:u%(c)=notfnpl(0):next:goto1680
  251. 1586 forc=0to15:on2+fnpl(0)gosub1688:next:ifn=12then1680
  252. 1588 ifn>=8orm%(8,pb)=0orm%(9,pb)=0orm%(10,pb)=0orm%(11,pb)=0then1598
  253. 1592 v=0:forc=0to15:gosub138:ifr=2orr=3thenw=r-2+s*4:if(vandb%(w))=0thenv=vorb%(w):gosub1688
  254. 1596 next:ifn=12then1680
  255. 1598 ifm%(17+sb,pb)<>1then1608
  256. 1602 v=0:forc=0to15:gosub138:iffnfr(0)thenif(vandb%(r))=0thenv=vorb%(r):gosub1688
  257. 1606 next:ifn=12then1680
  258. 1608 ifm%(16,pb)<>1then1618
  259. 1612 v=0:forc=0to15:gosub138:ifr=5thenif(vandb%(s))=0thenv=vorb%(s):gosub1688
  260. 1616 next:ifn=12then1680
  261. 1618 ifm%(12,pb)<>1orsb=1orsb=2then1628
  262. 1624 forc=0to15:gosub138:ifr=a2%(sb)ands=3-sbthengosub1688:c=15
  263. 1626 next:ifn=12then1680
  264. 1628 ifm%(4+sb,pb)=0andm%(8+sb,pb)=0then1638
  265. 1634 forc=0to15:gosub138:on2+(s=sband(r=2orr=3))gosub1688:next:ifn=12then1680
  266. 1638 m=3:fork=0tom:w=5-k+(k>1)+(k>2)
  267. 1642 forc=0to15:gosub138:on2+(s=sbandr=w)gosub1688:next:next:ifn=12then1680
  268. 1648 forc=0to15:gosub138:on2+(s<>sbandr=5)gosub1688:next:ifn=12then1680
  269. 1652 forc=0to15:gosub138:on2+(s=sb)gosub1688:next:ifn=12then1680
  270. 1658 forc=0to15:gosub138:on2+(r=4andch%(5,s,pb,pb)=2)gosub1688:next:ifn=12then1680
  271. 1664 m=3:v=sb:fork=1tom:v=a1%(v):ifch%(5,v,pb,pb)<>2orch%(4,v,pb,pb)=0then1668
  272. 1666 forc=0to15:gosub138:on2+(s=vandnotfnpl(0))gosub1688:next
  273. 1668 next:ifn=12then1680
  274. 1672 m=2:fork=0tom:forc=0to15:gosub138:on2+(r=kandnotfnpl(0))gosub1688:next:next:ifn=12then1680
  275. 1678 forc=0to15:on1+fnpl(0)gosub1688:next:ifn<12thenforc=0to15:gosub1688:next
  276. 1680 gosub254:iffnec(p)thenforc=0to15:on1+u%(c)gosub220:next:m=100:gosub36
  277. 1684 return
  278. 1688 ifu%(c)=0thenn=n+1:u%(c)=-1:ifn=12thenc=15:k=m
  279. 1694 return
  280. 1698 fori=0to3:c=v%(i):gosub138:ch%(r,s,pb,p)=ch%(r,s,pb,p)+1
  281. 1704 ch%(r,s,p,p)=ch%(r,s,p,p)-1:ch%(r,s,pb,pb)=ch%(r,s,pb,pb)+1:next:return
  282. 1710 forc=0to15:ifu%(c)then1722
  283. 1716 gosub138:ch%(r,s,px,pb)=ch%(r,s,px,pb)+1
  284. 1718 ch%(r,s,pb,pb)=ch%(r,s,pb,pb)-1:ch%(r,s,px,px)=ch%(r,s,px,px)+1
  285. 1720 ifch%(r,s,pb,px)>0thench%(r,s,pb,px)=ch%(r,s,pb,px)-1
  286. 1722 next:return
  287. 1728 z=2:gosub358:n=-1:fori=0to3:v%(i)=-1:next
  288. 1734 gosub12:on2+(q<>3)goto1746:on2+(bq<0)goto1736:on2+(n<>3)goto1734,1744
  289. 1736 fori=0to3:j=i:a=(c=v%(i)):i=i+(i-3)*a:next:ifa=0thenon2+(n=3)goto1734,1742
  290. 1738 cc=c%(3+(s%(c,p)and253)):gosub220:cc=c%(0):ifj=nthenn=n-1:v%(j)=-1:goto1734
  291. 1740 n=n-1:fori=jton:v%(i)=v%(i+1):next:goto1734
  292. 1742 gosub220:n=n+1:v%(n)=c:goto1734
  293. 1744 ifp=pbthenforc=0to15:u%(c)=-1:next:fori=0to3:u%(v%(i))=0:next
  294. 1746 gosub378:return
  295. 1802 p=a2%(pb):gosub1858:p=pb:t=tb:v=250+p%(sb,p,0)+p%(sb,a2%(p),0)
  296. 1810 ifv<bpthenifbp>500thenf=2:goto1817
  297. 1812 ifbp>500thenf=0:goto1817
  298. 1814 f=1+(v>=bp):iffnhp(p)thengosub1960:onqgoto1836,1836,1817
  299. 1816 gosub1930:gosub12:onqgoto1836,1836
  300. 1817 t=tb:onfgoto1818,1819:gosub1858:goto1820
  301. 1818 p%(sb,p,0)=0:p%(sb,a2%(p),0)=0:bp=500
  302. 1819 a$=a$(9+f):gosub234
  303. 1820 p=a1%(p):gosub1858:p=a2%(p):gosub1858:iff=2thenm=240:gosub36:gosub420:goto1836
  304. 1825 poke646,c%(3+t):a$=a$(20):iff=0thenl=4:n=bp:gosub494
  305. 1826 x=xs%(3)-4:y=ys%(2):gosub262
  306. 1827 l=4:n=p%(sb,t,0)+p%(sb,a2%(t),0):gosub494:x=xs%(1)+6:y=ys%(0)+1+t:gosub262
  307. 1828 a$=a$(21):np%(2)=250
  308. 1829 iff=0thenl=3:n=bp-n:n=n+(n-10)*(n<=0):np%(2)=n:gosub494
  309. 1830 x=xs%(1)+6:y=ys%(2):gosub262
  310. 1831 t=1-t:poke646,c%(3+t):l=4:n=p%(sb,t,0)+p%(sb,a2%(t),0):gosub494
  311. 1832 x=xs%(1)+6:y=ys%(0)+1+t:gosub262:poke646,c%(2)
  312. 1833 fors=0to3:forp=0to3:v=0:fori=0to3:v=v+sn%(s,i,p):next:ifv=12then1835
  313. 1834 px=p:fori=1to3:px=a1%(px):w=sn%(s,px,p):sn%(s,px,p)=w+(w-(-1))*(w=0):next
  314. 1835 next:next:m=240:gosub36:gosub284:forp=0to3:gosub102:next
  315. 1836 return
  316. 1858 c=-1:u=ca-1:fors=3to0step-1:forr=5to0step-1:u%(s*6+r)=0:ifch%(r,s,p,p)=0then1914
  317. 1866 forn=1toch%(r,s,p,p):c=c+1:onrgoto1874,1878,1884,1894,1890
  318. 1872 on2+(s=sb)goto1900,1906
  319. 1874 on2+((s=0andm%(12,p)=>n)or(m%(13,p)=>n))goto1900,1894
  320. 1878 ifs=sbandn=2andm%(4+s,p)>0then1900
  321. 1882 on2+(m%(8+s,p)=>nor(s=3andm%(12,p)=>n)orm%(14,p)=>n)goto1900,1894
  322. 1884 ifs=sbandn=2andm%(4+s,p)>0then1900
  323. 1888 on2+(m%(8+s,p)=>norm%(15,p)=>n)goto1900,1894
  324. 1890 ifm%(16,p)=>nthen1900
  325. 1894 ifs<>sbthen1906
  326. 1898 on2+(m%(17+s,p)>=n)goto1900,1906
  327. 1900 u%(s*6+r)=u%(s*6+r)+1:iffnec(p)then1910
  328. 1903 gosub138:u=u+1:x=x%(u,p):y=y%(u,p):gosub154:goto1910
  329. 1906 iffnec(p)thengosub220
  330. 1910 next
  331. 1914 next:next:a$=str$(p%(sb,p,0)):gosub234:j=p:fork=1to3:j=a1%(j):fors=0to3:forr=0to5
  332. 1924 v=u%(s*6+r):ifch%(r,s,p,j)>vthenv=ch%(r,s,p,j)
  333. 1926 ch%(r,s,p,j)=ch%(r,s,p,j)+v:sn%(s,p,j)=sn%(s,p,j)+v:next:next:next:return
  334. 1930 :
  335. 1934 fors=0to3:v%(s)=0:on2+(sn%(s,p,p)=0)goto1938:n=so%(s,p)-sn%(s,a2%(p),p):u=0
  336. 1935 fori=0to5:r=5-i:m=ch%(r,s,p,p):n=n-2:u=u+m:a=(m<2andn>0):i=i+(i-5)*a:next
  337. 1936 u%(s)=u
  338. 1937 v%(s)=u:on2+(r=0)goto1938:m=sn%(s,p,p)-(n+1)/2:on2+(m<1)goto1938:v%(s)=u+m
  339. 1938 next:u=v%(0)+v%(1)+v%(2)+v%(3)
  340. 1940 f=1+(1-2*f)*(u%(sb)*2<so%(sb,p)-sn%(sb,a2%(p),p)oru<12-f):return
  341. 1960 z=3+f:gosub358:gosub12:gosub378:ifq=3thenf=f+bq
  342. 1974 return
  343. 2002 sysml+129,fna(2),fna(2)+96,fna(4):z=5:gosub366:pw=pb:fornt=12to1step-1
  344. 2018 pl=pw:p=pl:nc=0:tp=0:iffnhp(p)thengosub2116:onqgoto2112,2112,2024
  345. 2022 gosub2172:onbgosub2754,2712,2720,2746:gosub12:onqgoto2112,2112
  346. 2024 sl=s%(c,p):gosub2134
  347. 2026 p=a1%(p):ifp=plthen2048
  348. 2030 nc=nc+1:iffnhp(p)thengosub2116:onqgoto2112,2112,2038
  349. 2034 onncgosub2286,2354,2422
  350. 2036 onbgosub2754,2712,2720,2746,2652,2762,2602:gosub12:onqgoto2112,2112
  351. 2038 gosub2134:ifs%(c,p)<>slthenifs%(c,p)=sbtheniftp=0thentp=-1:pw=p:goto2026
  352. 2042 ifs%(c,p)<>s%(t%(pw),pw)then2026
  353. 2044 ifr%(c,p)<=r%(t%(pw),pw)then2026
  354. 2046 pw=p:goto2026
  355. 2048 t=pwand253:y=yt%(pw)*8+52:x=xt%(pw)*8+24:v=0:ifx>255thenx=x-256:v=4+8
  356. 2052 pokevl+5,y:pokevl+4,x:pokevl+7,y:pokevl+6,x:pokevl+16,v:pokevl+21,1+2+4+8
  357. 2054 fori=0to3:np%(t)=np%(t)-10*(r%(t%(i),i)>2):next:np%(t)=np%(t)-10*(nt=1)
  358. 2058 fori=0to3:c=t%(i):cp%(r%(c,i),s%(c,i),0)=cp%(r%(c,i),s%(c,i),1):next
  359. 2061 v=0:fori=0to3:v=v-b%(i)*(s%(t%(i),i)=sl):next
  360. 2062 onvgoto2063,2064,2070,2065,2071,2073,2080,2066,2072,2074,2080,2075:goto2080
  361. 2063 i=0:goto2067
  362. 2064 i=1:goto2067
  363. 2065 i=2:goto2067
  364. 2066 i=3
  365. 2067 j=i:fork=1to3:j=a1%(j):forr=0to5:ch%(r,sl,i,j)=ch%(r,sl,i,i):next:next
  366. 2068 j=i:fork=1to3:j=a1%(j):sn%(sl,i,j)=so%(sl,j):next:goto2080
  367. 2070 i=0:j=1:goto2076
  368. 2071 i=0:j=2:goto2076
  369. 2072 i=0:j=3:goto2076
  370. 2073 i=1:j=2:goto2076
  371. 2074 i=1:j=3:goto2076
  372. 2075 i=2:j=3
  373. 2076 forr=0to5:ch%(r,sl,i,j)=ch%(r,sl,i,i):ch%(r,sl,j,i)=ch%(r,sl,j,j):next
  374. 2077 sn%(sl,i,j)=so%(sl,j):sn%(sl,j,i)=so%(sl,i)
  375. 2080 fori=0to3:r%(t%(i),i)=-1:s%(t%(i),i)=-1:t%(i)=-1:next
  376. 2088 m=60:gosub36:pokevl+21,1+2:gosub284:next:gosub420
  377. 2112 return
  378. 2116 a$=a$(22):gosub234:ifp<>plthenrx=r%(t%(pw),pw)
  379. 2120 gosub12:on2+(p=plorq<>3)goto2126
  380. 2121 ifsn%(sl,p,p)>0thenon2+(s%(c,p)<>sl)goto2120:on2+tpgoto2126:sp=sl:goto2124
  381. 2122 on2+(sn%(sb,p,p)=0)goto2126:on2+(s%(c,p)<>sb)goto2120:sp=sb:iftp=0thenrx=-1
  382. 2124 on2+(r%(c,p)>rx)goto2126
  383. 2125 fori=0to5:r=5-i:i=i+(i-5)*(ch%(r,sp,p,p)>0):next:ifr>rxthen2120
  384. 2126 gosub254:return
  385. 2134 t%(p)=c:gosub292:gosub138:x=xt%(p):y=yt%(p):gosub170:px=p:fork=1to3:px=a1%(px)
  386. 2143 ifs<>slthensn%(sl,p,px)=0
  387. 2144 so%(s,px)=so%(s,px)-1:ifch%(r,s,p,px)>0thench%(r,s,p,px)=ch%(r,s,p,px)-1
  388. 2146 ifsn%(s,p,px)<1then2150
  389. 2147 sn%(s,p,px)=sn%(s,p,px)-1:ifsn%(s,p,px)>0then2150
  390. 2148 w=so%(s,px):j=px:fori=1to3:j=a1%(j):m=sn%(s,j,px):w=w+m*(m>0):next
  391. 2149 sn%(s,p,px)=(w>0)
  392. 2150 next:px=p:w=so%(s,p):fork=1to3:px=a1%(px)
  393. 2152 ifsn%(s,px,p)=wthenj=p:fori=1to3:j=a1%(j):sn%(s,j,p)=0:next:sn%(s,px,p)=w
  394. 2154 next:ch%(r,s,p,p)=ch%(r,s,p,p)-1:sn%(s,p,p)=sn%(s,p,p)-1
  395. 2166 cp%(r,s,1)=cp%(r,s,1)+1:m=40:gosub36:return
  396. 2172 b=2:ifnt=1thenb=1:goto2282
  397. 2177 sp=sb:t=pand253:ifsn%(sb,p,p)=0then2206
  398. 2179 gosub2728:ifsn%(sb,p,p)<>ntthenon2+agoto2189,2206
  399. 2181 b=3+(aand(so%(sb,p)=1orch%(r,sb,p,p)=2or(nt=2andcp%(r,sb,1)=0))):goto2282
  400. 2189 ift<>tbthenifsn%(sb,p,p)<=so%(sb,p)then2206
  401. 2192 ifsn%(sb,p,p)*2>(nt)then2282
  402. 2194 ift=tbthenw=np%(td)+np%(2):ifw>=250andw<=250then2282
  403. 2195 gosub2770:ifathen2206
  404. 2196 ifsn%(sb,p,p)=1thengosub2712:ifcp%(r%(c,p),sb,1)=0then2282
  405. 2198 v=0:px=p:forx=1to3:px=a1%(px):gosub2806:v=v-a:next:ifv=0thenv=1
  406. 2202 ifsn%(sb,p,p)*v>=so%(sb,p)then2282
  407. 2204 ifp=a2%(pb)then2282
  408. 2206 sp=a1%(sp):ifsp=sbthen2216
  409. 2210 ifsn%(sp,p,p)>1then2206
  410. 2212 gosub2728:ifathengosub2712:ifcp%(r%(c,p),sp,1)=0then2282
  411. 2214 goto2206
  412. 2216 gosub2770:ifa=0then2228
  413. 2220 sp=a1%(sp):ifsp=sbthen2228
  414. 2222 ifsn%(sp,p,p)=0then2220
  415. 2224 gosub2728:ifathen2282
  416. 2226 goto2220
  417. 2228 ifsn%(sb,p,p)=0then2250
  418. 2232 ift<>tbthenifsn%(sb,p,p)<ntthen2250
  419. 2233 gosub2770:ifathenifsn%(sb,p,p)*2<=ntthen2250
  420. 2234 v=0:px=p:forx=1to3:px=a1%(px):gosub2806:v=v-a:next:ifv=0thenv=1
  421. 2238 ifsn%(sb,p,p)*v<=so%(sb,p)then2250
  422. 2239 gosub2728:ifathen2282
  423. 2240 ifso%(sb,p)-v=0thenb=3:goto2282
  424. 2241 forj=0to2:v=2-j:a=(ch%(v,sb,p,p)+cp%(v,sb,1)<2):j=j+(j-2)*a:next
  425. 2242 ifa=0orv=0then2245
  426. 2243 ifv=1thenifch%(1,sb,p,p)>0thenb=4:rx=0:goto2282
  427. 2244 ifch%(2,sb,p,p)>0thenb=4:rx=1:goto2282
  428. 2245 b=3:goto2282
  429. 2250 ifsn%(sp,p,p)=0then2256
  430. 2254 gosub2834:ifch%(r,sp,a1%(p),p)=0andch%(r,sp,a2%(p),p)>0then2282
  431. 2256 sp=a1%(sp):ifsp<>sbthen2250
  432. 2258 ifp=a2%(pb)andsn%(sb,p,p)>0then2282
  433. 2261 sl=-1
  434. 2262 sp=a1%(sp):ifsp=sbthenon2+slgoto2270:sp=sl:b=3:goto2282
  435. 2264 ifsn%(sp,p,p)=0then2262
  436. 2266 ifso%(sp,p)=0thenb=3:goto2282
  437. 2267 n=0:px=a1%(p):ifsn%(sp,px,p)=0thenn=1:sl=sp
  438. 2268 px=a2%(px):ifsn%(sp,px,p)=0thenn=n+1:sl=sp:ifn=2thenb=3:goto2282
  439. 2269 goto2262
  440. 2270 n=1:sl=-1
  441. 2274 sp=a1%(sp):ifsp=sbthensp=sl:gosub2728:b=3+a:goto2282
  442. 2276 ifsn%(sp,p,p)<nthen2274
  443. 2278 gosub2720:ifsl>-1thenifn=sn%(sp,p,p)thenifr%(c,p)>=rthen2274
  444. 2280 n=sn%(sp,p,p):r=r%(c,p):sl=sp:goto2274
  445. 2282 return
  446. 2286 b=4:ifnt=1thenb=1:goto2350
  447. 2292 u=0:px=a1%(p):gosub2778:v=r:ifa=0thenv=-1:gosub2806:ifathenu=1:v=r
  448. 2294 px=a2%(p):gosub2778:w=r:ifa=0thenw=-1:gosub2806:ifathenu=u+2:w=r
  449. 2297 ifsn%(sl,p,p)=0then2318
  450. 2298 sp=sl:ifsn%(sl,p,p)=1thenb=6:goto2350
  451. 2301 rx=r%(t%(pw),pw):gosub2712:gosub2834:ifrx>=r%(c,p)thenrx=-1:goto2308
  452. 2304 if(u=0andv>r%(c,p)andv>=w)oru=1or(u=3andv>=w)then2350
  453. 2305 ifsl<>sbthenifr%(c,p)=rthenb=2:goto2350
  454. 2306 ifsl=sbthenifsn%(sl,p,p)>=3then2350
  455. 2307 gosub2854:goto2350
  456. 2308 if(u=0and(r%(t%(pw),pw)>=worv>=w))oru=1or(u=3andv>=w)then2350
  457. 2313 gosub2854:goto2350
  458. 2318 ifsn%(sb,p,p)=0then2340
  459. 2322 sp=sb:ifsn%(sb,p,p)=1thenb=6:goto2350
  460. 2330 rx=-1:gosub2712:gosub2834
  461. 2332 if(u=1andv>r%(c,p))or(u=3andv>r%(c,p)andv>=w)then2350
  462. 2338 gosub2854:goto2350
  463. 2340 a=(pl=pbandsl=sb)
  464. 2342 ifathensp=sb:gosub2834:ifr%(t%(pb),pb)<>rthenb=7+(p<>a2%(pb))*2:goto2350
  465. 2348 b=7:if(u=0and(r%(t%(pw),pw)<wandv<w))oru=2or(u=3andv<w)thenb=5
  466. 2350 return
  467. 2354 b=4:ifnt=1thenb=1:goto2418
  468. 2360 u=0:px=a1%(p):gosub2778:v=r:ifa=0thenv=-1:gosub2806:ifathenu=1:v=r
  469. 2364 ifsn%(sl,p,p)=0then2388
  470. 2366 sp=sl:ifsn%(sl,p,p)=1thenb=6:goto2418
  471. 2370 iftpthenb=3:goto2418
  472. 2372 rx=r%(t%(pw),pw):gosub2712:gosub2834:ifrx>=r%(c,p)thenrx=-1:goto2382
  473. 2378 if(u=0andv>r%(c,p))oru=1then2418
  474. 2379 ifsl<>sbthenifr%(c,p)=rthenb=2:goto2418
  475. 2380 ifsl=sbthenifsn%(sl,p,p)>=3then2418
  476. 2381 gosub2854:goto2418
  477. 2382 ifp<>a2%(pw)or(u=0andv>r%(t%(pw),pw))oru=1then2418
  478. 2385 gosub2854:goto2418
  479. 2388 ifsn%(sb,p,p)=0then2408
  480. 2390 sp=sb:ifsn%(sb,p,p)=1thenb=6:goto2418
  481. 2394 rx=r%(t%(pw),pw):gosub2712:gosub2834:iftp=0thenrx=-1:goto2400
  482. 2398 ifrx>=r%(c,p)thenrx=-1:goto2418
  483. 2400 ifu=1andv>r%(c,p)then2418
  484. 2406 gosub2854:goto2418
  485. 2408 b=7:ifp<>a2%(pw)then2418
  486. 2411 a=(pl=pbandsl=sb)
  487. 2412 ifathensp=sb:gosub2834:ifr%(t%(pb),pb)<>rthenb=7+(p<>a2%(pb))*2:goto2418
  488. 2416 ifu=0andr%(t%(pw),pw)>=vthenb=5
  489. 2418 return
  490. 2422 b=4:ifnt=1thenb=1:goto2472
  491. 2432 ifsn%(sl,p,p)=0then2450
  492. 2434 sp=sl:ifsn%(sp,p,p)=1thenb=6:goto2472
  493. 2437 rx=r%(t%(pw),pw):gosub2712:gosub2834:iftpthenrx=-1:goto2441
  494. 2440 ifrx>=r%(c,p)thenrx=-1
  495. 2441 ifp<>a2%(pw)then2472
  496. 2444 gosub2854:goto2472
  497. 2450 ifsn%(sb,p,p)=0then2468
  498. 2454 sp=sb:ifsn%(sb,p,p)=1thenb=6:goto2472
  499. 2458 rx=r%(t%(pw),pw):gosub2712:gosub2834:iftp=0thenrx=-1:goto2466
  500. 2460 ifrx>=r%(c,p)thenrx=-1
  501. 2461 ifp<>a2%(pw)then2472
  502. 2466 gosub2854:goto2472
  503. 2468 b=7+(p=a2%(pw))*2
  504. 2472 return
  505. 2602 z=-1:v=3
  506. 2608 u=-1:forsp=0to3:ifsn%(sp,p,p)=0then2614
  507. 2612 ifso%(sp,p)=0thengosub2720:ifr%(c,p)<vthenw=fnsl(sp):ifw>uthenz=c:u=w
  508. 2614 next:ifz>-1then2648
  509. 2618 u=-1:forsp=0to3:ifsn%(sp,p,p)=0then2622
  510. 2620 ifsn%(sp,pb,p)=0thengosub2720:ifr%(c,p)<vthenw=fnsl(sp):ifw>uthenz=c:u=w
  511. 2622 next:ifz>-1then2648
  512. 2626 u=-1:forsp=0to3:ifsn%(sp,p,p)=0then2634
  513. 2627 if(pand253)<>tbthenifsn%(sp,p,p)=sn%(sp,pb,p)+1then2634
  514. 2628 gosub2728:ifatheniffnl2(sp)then2634
  515. 2630 w=fnsl(sp):ifr>2thenifw=1then2634
  516. 2632 gosub2720:ifr%(c,p)<vthenifr%(c,p)<>rorch%(r,sp,p,p)=2thenifw>uthenz=c:u=w
  517. 2634 next:ifz>-1then2648
  518. 2638 ifv=3thenv=6:goto2608
  519. 2640 forsp=0to3:ifsn%(sp,p,p)<>1then2642
  520. 2641 gosub2712:gosub2728:ifa=0orcp%(r%(c,p),sp,1)=0thens=sp:sp=3
  521. 2642 next:ifz>-1then2648
  522. 2644 forsp=0to3:ifsn%(sp,p,p)>0thengosub2720:ifr%(c,p)<vthenv=r%(c,p):z=c:ifv=0thensp=3
  523. 2647 next
  524. 2648 c=z:return
  525. 2652 s=-1:v=2
  526. 2658 forsp=0to3:ifsn%(sp,p,p)<>1then2664
  527. 2662 gosub2712:ifr%(c,p)>vthengosub2728:ifa=0orcp%(r%(c,p),sp,1)=0thens=sp:sp=3
  528. 2664 next:ifs>-1then2708
  529. 2668 u=13:forsp=0to3:ifsn%(sp,p,p)=0then2672
  530. 2670 ifso%(sp,p)=0thengosub2712:ifr%(c,p)>vthenw=fnsl(sp):ifw<uthens=sp:u=w
  531. 2672 next:ifs>-1thensp=s:goto2704
  532. 2676 u=13:forsp=0to3:ifsn%(sp,p,p)=0then2680
  533. 2678 ifsn%(sp,pb,p)=0thengosub2712:ifr%(c,p)>vthenw=fnsl(sp):ifw<uthens=sp:u=w
  534. 2680 next:ifs>-1thensp=s:goto2704
  535. 2684 u=13:forsp=0to3:ifsn%(sp,p,p)=0then2692
  536. 2685 if(pand253)<>tbthenifsn%(sp,p,p)=sn%(sp,pb,p)+1then2692
  537. 2686 gosub2728:ifatheniffnl2(sp)then2692
  538. 2688 gosub2712:on2+(r%(c,p)>2)gosub2842:ifr%(c,p)<=vthen2692
  539. 2690 ifr%(c,p)<>rorch%(r,sp,p,p)=2thenw=fnsl(sp):ifw<uthens=sp:u=w
  540. 2692 next:ifs>-1thensp=s:goto2704
  541. 2696 ifv=2thenv=-1:goto2658
  542. 2700 v=6:forsp=0to3:ifsn%(sp,p,p)>0thengosub2720:ifr%(c,p)<vthenv=r%(c,p):w=c
  543. 2702 next:c=w:goto2708
  544. 2704 on2+(v=2)gosub2842,2720
  545. 2708 return
  546. 2712 fori=0to11:c=i:i=i+(i-11)*(s%(c,p)=spandr%(c,p)>-1):next:return
  547. 2720 fori=0to11:c=11-i:i=i+(i-11)*(s%(c,p)=spandr%(c,p)>-1):next:return
  548. 2728 gosub2834:a=(ch%(r,sp,p,p)<>0):ifathenifsp<>sbandp<>pbthengosub2738:a=nota
  549. 2734 return
  550. 2738 a=(sn%(sb,pb,p)=nt+(pb=plor(nc=2anda2%(p)=pb)ornc=3)):return
  551. 2746 fori=0to11:c=11-i:i=i+(i-11)*(s%(c,p)=spandr%(c,p)>rx):next:return
  552. 2754 fori=0to11:a=(r%(i,p)>-1):c=i:i=i+(i-11)*a:next:return
  553. 2762 fori=0to11:a=(s%(i,p)=sp):c=i:i=i+(i-11)*a:next:return
  554. 2770 a=((so%(sp,p)=0)or(sn%(sp,a1%(p),p)=0andsn%(sp,a2%(a1%(p)),p)=0)):return
  555. 2778 ifso%(sl,p)=0orsn%(sl,px,p)=0thena=0:goto2802
  556. 2784 ifsn%(sl,px,p)=-1then2788
  557. 2786 a=-1:fori=0to5:r=5-i:i=i+(i-5)*(ch%(r,sl,px,p)>0):next:goto2802
  558. 2788 ifp=a2%(pb)thenifsl=sbthena=0:goto2802
  559. 2790 n=4*nt-nc:a=(so%(sl,p)=n):ifathen2796
  560. 2792 j=p:k=so%(sl,p):forl=1to3:j=a1%(j):m=sn%(sl,j,p):k=k+m*(m>0):next
  561. 2794 a=(nt*k/n>0.5+0.125*(2-d%(0,0))):ifa=0then2802
  562. 2796 fori=0to5:r=i:k=cp%(r,sl,1):ifk=2then2800
  563. 2798 forj=0to3:k=k+ch%(r,sl,j,p):j=j+(j-3)*(k=2):next:i=i+(i-5)*(k<2)
  564. 2800 next:ifk=2thenr=l
  565. 2802 return
  566. 2806 ifso%(sb,p)=0orsn%(sb,px,p)=0thena=0:goto2830
  567. 2812 ifsn%(sb,px,p)=-1then2816
  568. 2814 a=-1:fori=0to5:r=5-i:i=i+(i-5)*(ch%(r,sb,px,p)>0):next:goto2830
  569. 2816 ifp=a2%(pb)thena=0:goto2830
  570. 2818 n=4*nt-nc:a=(so%(sb,p)=n):ifathen2824
  571. 2820 j=p:k=so%(sb,p):forl=1to3:j=a1%(j):m=sn%(sb,j,p):k=k+m*(m>0):next
  572. 2822 a=(nt*k/n>0.5+0.125*(2-d%(0,0))):ifa=0then2830
  573. 2824 fori=0to5:r=i:k=cp%(r,sb,1):ifk=2then2828
  574. 2826 forj=0to3:k=k+ch%(r,sb,j,p):j=j+(j-3)*(k=2):next:i=i+(i-5)*(k<2)
  575. 2828 next:ifk=2thenr=l
  576. 2830 return
  577. 2834 fori=0to5:r=5-i:i=i+(i-5)*(cp%(r,sp,0)<>2):next:return
  578. 2842 j=2:ifch%(4,sp,p,p)>0thengosub2834:ifr<>4thenj=3
  579. 2848 fori=0to11:c=11-i:i=i+(i-11)*(s%(c,p)=spandr%(c,p)>j):next:return
  580. 2854 ifrx>1orr%(c,p)<3then2874
  581. 2860 ifch%(r,sp,p,p)=0thenrx=2:goto2874
  582. 2862 gosub2746:ifr%(c,p)>2then2874
  583. 2864 iffnl2(sp)thenrx=2:goto2874
  584. 2866 ifrx=-1thenrx=2:gosub2746:on2+(r%(c,p)<>r)goto2874:rx=-1
  585. 2868 ifsp=sborp=pbthen2874
  586. 2870 gosub2738:ifathenrx=2:goto2874
  587. 2872 px=pb:gosub2778:ifa=0thengosub2806:ifathenrx=2
  588. 2874 return
  589. 2902 q=2:gosub402:ns%(0)=0:ns%(1)=0:gosub474
  590. 2910 poke176,lr:poke177,hr:poke178,4:sysrl:pd=peek(rv)-1:return
  591. 2916 gosub342:sysml+126,0,39,0,24,222,223,c%(1),12:poke53281,c%(4)
  592. 2922 sysml+48,3,36,3,14,fna(0):pokemv,ls:pokemv+2,12:pokerv+57,d%(1,0):pokerv+58,d%(2,0)
  593. 2926 sysml+9:ifcr%=0thensysml+60,a$(29):cr%=i%:ifcr%=0then2926
  594. 2928 oncr%goto2933
  595. 2930 forj=0to3:i=3-j:j=j+(j-3)*(cr%>=d%(i,1)):next:ifcr%=d%(i,0)+d%(i,1)then2926
  596. 2932 i%=d%(i,0)+d%(i,1):gosub386:i%=cr%:gosub394:d%(i,0)=cr%-d%(i,1):goto2926
  597. 2933 sysml+45,3,36,3,14,fna(0):gosub350:ifd%(1,0)<>peek(rv+57)thenifd%(1,0)=0thenq=4:bn=-1
  598. 2935 ifd%(2,0)=peek(rv+58)then2960
  599. 2938 forj=1to3:l=(j=pbandcn=16)
  600. 2940 iflthensysml+30,x%(0,j),x%(15,j)+1,y%(0,j),y%(15,j)+1,160,c%(2)
  601. 2942 k=-1:fori=2+(2-ca)*lto13+(13-cz)*l:k=k+1:ifk=t%(j)ors%(k,j)=-1then2958
  602. 2944 ifd%(2,0)=0thenon(jand253)+1goto2954,2956
  603. 2946 poke646,c%(3+(s%(k,j)and253))
  604. 2948 if(jand253)=1thensysml+12,x%(i,j),y%(i,j),r$(r%(k,j))+s$(s%(k,j)):goto2958
  605. 2950 sysml+12,x%(i,j),y%(i,j),r$(r%(k,j))
  606. 2952 sysml+12,x%(i,j),y%(i,j)+1,s$(s%(k,j)):goto2958
  607. 2954 sysml+126,x%(i,j),x%(i,j),y%(i,j),y%(i,j)+1,97,98,c%(2),c%(2):goto2958
  608. 2956 sysml+12,x%(i,j),y%(i,j),a$(23)
  609. 2958 next:next:poke646,c%(2)
  610. 2960 return
  611. 2964 gosub342:sysml+42,hh:pokemv,lh:pokemv+2,6
  612. 2970 sysml+210,1+128,38,3,20,c%(0),c%(0),c%(4),c%(3),0,"","":gosub350:return
  613. 2978 gosub342:sysml+126,0,39,0,24,222,223,c%(1),12:poke53281,c%(4)
  614. 2984 sysml+48,10,29,6,12,fna(1):pokemv,lq:pokemv+2,2
  615. 2986 sysml+9:i%=cr%:ifi%=0thensysml+60,a$(30):ifi%=0then2986
  616. 2988 ifi%=1thenq=1
  617. 2990 gosub350:return
  618. 3002 ifdv=0thendv=peek(186):dv=dv+(dv-8)*(dv<8ordv>29):load"rh-pinochle 1",dv
  619. 3012 deffna(x)=32768+a%(x):deffnec(x)=(x=0ord%(2,0)=1)
  620. 3016 deffnfr(x)=(s%(c,p)=sbandr%(c,p)>0):deffnhp(x)=(x=0andd%(1,0)=1)
  621. 3020 deffnl2(x)=(sn%(x,p,p)=2andch%(r,x,p,p)=1andcp%(r,x,1)=0)
  622. 3022 deffnmm(x)=x+(x-10)*(x=2)
  623. 3024 deffnpl(x)=((s%(c,p)=0andr%(c,p)=1)or(s%(c,p)=3andr%(c,p)=2))
  624. 3026 deffnsl(x)=ch%(0,x,p,p)+ch%(1,x,p,p)+ch%(2,x,p,p):poke53265,27
  625. 3032 poke198,0:wait198,15:poke198,0:sysmm:sysml:sysml+18,1,38,0,20
  626. 3040 sysml+6,u%(2)*256:pokemm+9,0:sysml+42,hg:return
  627. 4002 pokevl+21,0:sysml+3:sysmm+3:poke648,4:poke53272,23:poke56576,199:print"[147]"
  628. 4010 fori=0to21:poke828+i,8+i:next:ifdv<8ordv>29ordv=8then4016
  629. 4014 a=peek(828):b=peek(828+dv-8):poke828,b:poke828+dv-8,a
  630. 4016 a$="hello connect":forj=8to29:i=peek(828+j-8):ifi=14thennext
  631. 4018 close2:open2,i,2:close2:ifstthen4022
  632. 4020 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then4024
  633. 4022 next:print"[147]":poke53272,23:poke186,8:end
  634. 4024 q$=chr$(34):poke646,peek(53281):print"[147]":poke53272,23
  635. 4026 print"[147]p[207]2048,0:p[207]44,8:p[207]43,1:p[207]56,160:p[207]55,0:clr:l[207]"q$a$q$","i
  636. 4028 print"run:":poke631,13:poke632,13:poke198,2:end
  637. 10000 a$="rh-pinochle 2c"
  638. 10010 dv=peek(186):open15,dv,15,"s0:"+a$:close15:savea$,dv:end
  639.